home *** CD-ROM | disk | FTP | other *** search
Wrap
/* ============================================================================== ============================================================================== ToolManager2M2I V0.20 (C) Ringard' Production - TS "Pumpkin" Rexx Cucurbitacee Construction d'une configuration M2I a partir d'un fichier de config ToolManager traduite en ASCII par TM2ASCII. V0.19 : - propose la possibilite de definir un dock principal, afin d'eviter des demandes de duplication intempestive. - gere totalement les appels croise (dock0->dock1->...->dock0) - ecriture d'un fichier "log" dans le repertoire ou se trouve la cfg TM (chemin indique suivant la syntaxe arexx de M2I) - les hotkey non acceptes par M2I et ceux des docks TM sont supprimes (pas de hotkey pour un tiroir M2I) Tous bugs, suggestions et remarques sont a adresses a : Thierry SCHMITT (tschmitt@hol.fr) ============================================================================== ============================================================================== */ icondx = 0 /* valeur X & Y de correction pour les icones: correspond */ icondy = 14 /* a la pos. du coin haut/gauche d'une icones ToolManager */ OPTIONS RESULTS ADDRESS "M2IPort.Rexx" REQUEST GADGETS "QUIT|CONTINUE" "AVERTISSEMENT !! : Une entité ToolManager de meme type avec strictement le même"||'0a'x||, "nom crashe le programme de conversion ( icone1: 'Wipe Out' = icone2: 'Wipe Out' est"||'0a'x||, "prohibe mais icone1: 'Wipe Out' & menu1: 'Wipe Out' convient ). Il n'est pas possible,"||'0a'x||, "à cause des contraintes d'Arexx, de remedier à cela, désole !" IF RC=1 THEN EXIT MESSAGE "Choisissez le fichier de config ToolManager a traiter" REQFILE IF RC~=0 THEN DO MESSAGE "Erreur/fichier ou abandon !" CALL Exit_M2I2TM END tm_file = RESULT flg= OPEN('tm_cfgfile',tm_file,'R') MESSAGE "Les objets de toolmanager ne definissent pas toujours un volume par defaut,"||'0a'x||"necessaire sous M2I...Choisissez le volume par default (DH0:, SYS:,...)" REQDIR "SYS:" IF RC~=0 THEN DO MESSAGE "Abandon !" CALL Exit_M2I2TM END defdospath=RESULT IF defdospath="" THEN defdospath="SYS:" MESSAGE "Ou mettre le fichier de compte-rendu ?" REQFILE "T:TM2M2I.log" IF RC~=0 THEN DO MESSAGE "Erreur/fichier ou abandon !" CALL Exit_M2I2TM END log_file = RESULT flg = OPEN('log',log_file,'W') /* ============================== */ /* CREATION B.D DU FICHIER CONFIG */ /* ============================== */ /* ------------------------- */ /* --- hotkey autorisees --- */ /* ------------------------- */ flg = SETCLIP("hotkey LSHIFT","LSHIFT") flg = SETCLIP("hotkey LEFT_SHIFT","LSHIFT") flg = SETCLIP("hotkey RSHIFT","RSHIFT") flg = SETCLIP("hotkey RIGHT_SHIFT","RSHIFT") flg = SETCLIP("hotkey SHIFT","RSHIFT") flg = SETCLIP("hotkey CONTROL","CTRL") flg = SETCLIP("hotkey CTRL","CTRL") flg = SETCLIP("hotkey LALT","LALT") flg = SETCLIP("hotkey LEFT_ALT","LALT") flg = SETCLIP("hotkey RALT","RALT") flg = SETCLIP("hotkey RIGHT_ALT","RALT") flg = SETCLIP("hotkey ALT","RALT") flg = SETCLIP("hotkey LCOMMAND","LCOMMAND") flg = SETCLIP("hotkey LAMIGA","LCOMMAND") flg = SETCLIP("hotkey LEFT_AMIGA","LCOMMAND") flg = SETCLIP("hotkey LEFT_COMMAND","LCOMMAND") flg = SETCLIP("hotkey RCOMMAND","RCOMMAND") flg = SETCLIP("hotkey RAMIGA","RCOMMAND") flg = SETCLIP("hotkey RIGHT_AMIGA","RCOMMAND") flg = SETCLIP("hotkey RIGHT_COMMAND","RCOMMAND") /* ------------------- */ /* --- exec object --- */ /* ------------------- */ SAY "---execs---" flg = WRITELN('log',"---execs---") execcnt= 0 flg = READLN('tm_cfgfile') /* ligne de section "Exec Objects" */ IF flg~="Exec Objects" THEN DO MESSAGE "Ca ne ressemble pas a un fichier"||'0a'x||"de cfg ToolManage en Ascii : Abandon!" CALL Exit_M2I2TM END section = READLN('tm_cfgfile') DO WHILE section~="---" execname = "execobj "||section flg = WRITELN('log',execname) execinfo = READLN('tm_cfgfile') execinfo = execinfo||"¶"||READLN('tm_cfgfile') execinfo = execinfo||"¶"||READLN('tm_cfgfile') execinfo = execinfo||"¶"||READLN('tm_cfgfile') execinfo = execinfo||"¶"||READLN('tm_cfgfile') execinfo = execinfo||"¶"||READLN('tm_cfgfile') execinfo = execinfo||"¶"||READLN('tm_cfgfile') flg = SETCLIP(execname,execinfo) execcnt = execcnt + 1 section = READLN('tm_cfgfile') END SAY execcnt flg = WRITELN('log','total tools: '||execcnt) /* -------------------- */ /* --- image object --- */ /* -------------------- */ SAY "---images---" flg = WRITELN('log',"---images---") imagcnt = 0 flg = READLN('tm_cfgfile') /* ligne de section "Image Objects" */ section = READLN('tm_cfgfile') DO WHILE section~="---" imagname = "imagobj "||section flg = WRITELN('log',imagname) imaginfo = READLN('tm_cfgfile') flg = SETCLIP(imagname,imaginfo) imagcnt = imagcnt + 1 section = READLN('tm_cfgfile') END SAY imagcnt flg = WRITELN('log','total images: '||imagcnt) /* -------------------- */ /* --- sound object --- */ /* -------------------- */ SAY "---sounds---" flg = WRITELN('log',"---sounds---") soundcnt = 0 flg = READLN('tm_cfgfile') /* ligne de section "Sound Objects" */ section = READLN('tm_cfgfile') DO WHILE section~="---" soundname = "soundobj "||section flg = WRITELN('log',soundname) soundinfo = READLN('tm_cfgfile') IF UPPER(WORD(soundinfo,1))="FILE" THEN DO ppos = WORDINDEX(soundinfo,2) soundinfo=SUBSTR(soundinfo,ppos,LENGTH(soundinfo)-ppos+1) END nil = READLN('tm_cfgfile') /* saute def port arexx */ flg = SETCLIP(soundname,soundinfo) soundcnt = soundcnt + 1 section = READLN('tm_cfgfile') END SAY soundcnt flg = WRITELN('log','total sons: '||soundcnt) flg = SETCLIP('finelem','dummy') /* -------------------- */ /* --- menu object --- */ /* -------------------- */ SAY "---menus---" flg = WRITELN('log',"---menus---") menucnt = 0 flg = READLN('tm_cfgfile') /* ligne de section "Menu Objects" */ section = READLN('tm_cfgfile') DO WHILE section~="---" menuname = "menuobj "||section flg = WRITELN('log',menuname) menuinfo = READLN('tm_cfgfile') menuinfo = menuinfo||"¶"||READLN('tm_cfgfile') flg = SETCLIP(menuname,menuinfo) menucnt = menucnt + 1 section = READLN('tm_cfgfile') END SAY menucnt flg = WRITELN('log','total menus: '||menucnt) /* ------------------- */ /* --- icon object --- */ /* ------------------- */ SAY "---icons---" flg = WRITELN('log',"---icons---") iconcnt = 0 flg = READLN('tm_cfgfile') /* ligne de section "Icon Objects" */ section = READLN('tm_cfgfile') DO WHILE section~="---" iconname = "iconobj "||section flg = WRITELN('log',iconname) iconinfo = READLN('tm_cfgfile') iconinfo = iconinfo||"¶"||READLN('tm_cfgfile') iconinfo = iconinfo||"¶"||READLN('tm_cfgfile') iconinfo = iconinfo||"¶"||READLN('tm_cfgfile') iconinfo = iconinfo||"¶"||READLN('tm_cfgfile') flg = SETCLIP(iconname,iconinfo) iconcnt = iconcnt + 1 section = READLN('tm_cfgfile') END SAY iconcnt flg = WRITELN('log','total icones: '||iconcnt) /* ------------------- */ /* --- dock object --- */ /* ------------------- */ SAY "---docks---" flg = WRITELN('log',"---docks---") dockcnt = 0 flg = READLN('tm_cfgfile') /* ligne de section "Dock Objects" */ docksection = READLN('tm_cfgfile') dockliste = "" DO WHILE docksection~="---" dockliste = dockliste||'0a'x||docksection dockname = "dockobj "||docksection flg = WRITELN('log',dockname) dockinfo = READLN('tm_cfgfile') /*flags*/ dockinfo = dockinfo||"¶"||READLN('tm_cfgfile') /*hotkey*/ dockinfo = dockinfo||"¶"||READLN('tm_cfgfile') /*pubscreen*/ dockinfo = dockinfo||"¶"||READLN('tm_cfgfile') /*docktitle*/ flg = READLN('tm_cfgfile') /*fonts - inutilise !!*/ dockinfo = dockinfo||"¶"||READLN('tm_cfgfile') /*taille fonts*/ dockinfo = dockinfo||"¶"||READLN('tm_cfgfile') /*position*/ flg = READLN('tm_cfgfile') /*nbre de colonnes - inutilise !!*/ flg = READLN('tm_cfgfile') /* ligne de section "Tools" */ section = READLN('tm_cfgfile') DO WHILE section~="---" dockinfo = dockinfo||"¶"||section dockinfo = dockinfo||"¶"||READLN('tm_cfgfile') dockinfo = dockinfo||"¶"||READLN('tm_cfgfile') section = READLN('tm_cfgfile') END flg = SETCLIP(dockname,dockinfo) dockcnt = dockcnt + 1 docksection = READLN('tm_cfgfile') END SAY dockcnt flg = WRITELN('log','total docks: '||dockcnt) maindock = "dummy" savemain = "" dockexists = 0 DO WHILE dockexists=0 | maindock="" REQSTRING "Avez-vous un dock principal ?"||'0a'x||, "entrez le nom (sensitive !), sinon Ok/Enter"||'0a'x||, "Taper des caracteres quelconques voir la liste des docks" maindock = RESULT flg = RC IF flg = 5 THEN maindock="" IF flg = 5 THEN LEAVE dockexists = 1 IF maindock~="" THEN DO flg = GETCLIP("dockobj "||maindock) IF flg = "" THEN DO MESSAGE "dock "||maindock||" non trouve !" dockexists=0 MESSAGE "liste des docks :"||'0a'x||dockliste END END END /* ============================== */ /* TRAITEMENT DES CLIPS - INSTALL */ /* ============================== */ flg = CLOSE('tm_cfgfile') flg = WRITELN('log','0A'X) flg = WRITELN('log','Traitement...'||'0A'X) flg = WRITELN('log','...Menus'||'0a'x) allclips = SHOW(CLIP) allclips = RIGHT(allclips,LENGTH(allclips)-POS("finelem",allclips)) allclips = DELWORD(allclips,1,1) /*clip finelem*/ drwcnt = 1 GET XPOS ":" orig_x = RESULT orig_x = orig_x + 6 GET YPOS ":" orig_y = RESULT orig_y = orig_y + 40 /* ------------------------- */ /* --- creation drw menu --- */ /* ------------------------- */ /* clip menuobj : nom_execobj|nom_soundobj */ /* ....................................... */ M2Ipath = ":" ADDDRW "M2I_Menu" M2Ipath REDRAW M2Ipath M2Ipath = M2Ipath||drwcnt SET XPOS orig_x M2Ipath SET YPOS orig_y M2Ipath SET WLIST 2 M2Ipath /* = texte */ SET LOCK 6 M2Ipath /* = 3D */ OPENDRW M2Ipath toolnum = 1 DO WHILE menucnt~=0 allclips = DELWORD(allclips,1,1) ppos = POS("menuobj",allclips) IF ppos = 0 THEN ppos = POS("iconobj",allclips) menutool = LEFT(allclips,ppos-2) allclips = RIGHT(allclips,LENGTH(allclips)-ppos+1) /*clip menu*/ newmenu = GETCLIP("menuobj "||menutool) /*clip exec*/ ppos = POS("¶",newmenu) toolname = LEFT(newmenu,ppos-1) newinfo = GETCLIP("execobj "||toolname) IF newinfo="" THEN ITERATE /*clip sound*/ newsound = RIGHT(newmenu,LENGTH(newmenu)-ppos) toolsound = GETCLIP("soundobj "||newsound) toolimag = "" M2Ienv = M2Ipath CALL Def_M2Itool toolnum = RESULT REDRAW M2Ipath menucnt = menucnt - 1 END CLOSEDRW M2Ipath /* -------------------------- */ /* --- creation drw icons --- */ /* -------------------------- */ /* clip iconobj : flag_nom_visible|nom_execobj|imag|sound|position */ /* ............................................................... */ flg = WRITELN('log','0a'x||'...Icones'||'0a'x) drwcnt = drwcnt + 1 orig_x = orig_x + 70 M2Ipath = ":" ADDDRW "M2I_Icons" M2Ipath REDRAW M2Ipath M2Ipath = M2Ipath||drwcnt SET XPOS orig_x M2Ipath /*look drawers du drw "icons"*/ SET YPOS orig_y M2Ipath SET WLIST 1 M2Ipath /* = verticale */ SET LOCK 6 M2Ipath /* = 3D */ OPENDRW M2Ipath iconnum = 1 DO WHILE iconcnt~=0 toolnum = 1 allclips = DELWORD(allclips,1,1) ppos = POS("iconobj",allclips) IF ppos = 0 THEN ppos = POS("dockobj",allclips) icontool = LEFT(allclips,ppos-2) allclips = RIGHT(allclips,LENGTH(allclips)-ppos+1) M2Iicondrw = M2Ipath||"/"||iconnum /*clip menu*/ newicon = GETCLIP("iconobj "||icontool) ppos = POS("¶",newicon) newiname = LEFT(newicon,ppos-1) /* flag "nom visible" */ newicon = RIGHT(newicon,LENGTH(newicon)-ppos) /*clip exec*/ ppos = POS("¶",newicon) toolname = LEFT(newicon,ppos-1) newinfo = GETCLIP("execobj "||toolname) IF newinfo="" THEN ITERATE newicon = RIGHT(newicon,LENGTH(newicon)-ppos) /*clip imag*/ ppos = POS("¶",newicon) newimag = LEFT(newicon,ppos-1) toolimag = GETCLIP("imagobj "||newimag) newicon = RIGHT(newicon,LENGTH(newicon)-ppos) /*clip sound*/ ppos = POS("¶",newicon) newsound = LEFT(newicon,ppos-1) toolsound = GETCLIP("soundobj "||newsound) ppos = POS("¶",newicon) /*position*/ newpos = RIGHT(newicon,LENGTH(newicon)-ppos) ADDDRW '"'||toolname||'"' M2Ipath /* =":2" */ REDRAW M2Ipath M2Ienv = M2Ipath||"/"||iconnum /* chemin du tool-icon courant */ OPENDRW M2Ienv CALL Def_M2Itool toolnum = RESULT IF newiname THEN DO SET LABEL toolname M2Iicondrw||"/1" /* =":n/n/1" -> icon */ END ELSE DO SET LABEL '' M2Iicondrw||"/1" /* =":n/n/1" -> icon */ END CLOSEDRW M2Iicondrw SET ICON toolimag M2Iicondrw SET IPLACE 0 M2Iicondrw /* centree */ SET WLIST 1 M2Iicondrw /* = verticale */ SET LOCK 6 M2Iicondrw /* = 3D */ SET XPOS WORD(newpos,1)+icondx M2Iicondrw SET YPOS WORD(newpos,2)+icondy M2Iicondrw OPENDRW M2Iicondrw REDRAW M2Ipath iconcnt = iconcnt - 1 iconnum = iconnum + 1 /* detruire tiroir amont si non duplication (toolnum non passe a 2) */ IF toolnum=1 THEN DO DELETE M2Iicondrw REDRAW M2Ipath iconnum = iconnum - 1 END END CLOSEDRW M2Ipath /* --------------------------- */ /* --- creation drws docks --- */ /* --------------------------- */ /* clip dockobj : ??|hotkey|pubscreen|docktitle|??|pos|..*/ /* ..nom_execobj|imag_execobj|sound_execobj */ /* ..................................................... */ flg = WRITELN('log','0a'x||'...Docks'||'0a'x) drwcnt = drwcnt + 1 orig_x = orig_x + 70 M2Ipath = ":" ADDDRW "M2I_Docks" M2Ipath REDRAW M2Ipath M2Ipath = M2Ipath||drwcnt SET XPOS orig_x M2Ipath SET YPOS orig_y M2Ipath SET WLIST 1 M2Ipath /* = verticale */ SET LOCK 6 M2Ipath /* = 3D */ OPENDRW M2Ipath toolnum = 1 DO WHILE dockcnt~=0 /* traiter main en 1er */ IF maindock~="" & maindock~="dummydummydummy" THEN DO dockname = maindock END ELSE DO allclips = DELWORD(allclips,1,1) ppos = POS("dockobj",allclips) IF ppos = 0 THEN DO dockname = allclips END ELSE DO dockname = LEFT(allclips,ppos-2) allclips = RIGHT(allclips,LENGTH(allclips)-ppos+1) END END nodup=1 GETPATH dockname dupdock = rc /* pour ne plus traiter le main */ IF savemain = dockname THEN DO dupdock = -1 nodup = 0 END IF dupdock=0 THEN DO CALL check_ref_croisee M2Ipath dockname nodup = RESULT IF nodup=0 THEN DO IF maindock~="dummydummydummy" THEN DO flg = WRITELN('log',M2Ipath||'09'x||'09'x||"DUPLICA ! - Dock "||dockname) GETPATH M2Ipath ddduppath = RESULT M2Iwarn = "le dock "||dockname||" existe.duplication?" REQUEST M2Iwarn nodup = rc END END END IF nodup=1 THEN DO flg = WRITELN('log',M2Ipath||'09'x||'09'x||" Dock "||dockname||" traite") ADDDRW '"'||dockname||'"' M2Ipath REDRAW M2Ipath /* SET WLIST 1 M2Ipath /* = verticale */ SET LOCK 2 M2Ipath /* = cadre */ */ M2Ienv = M2Ipath||"/"||toolnum OPENDRW M2Ienv CALL mkdock dockflags = RESULT toolnum = toolnum + 1 END dockcnt = dockcnt - 1 /* SUPRESSION virtuelle du MAIN-DOCK apres traitement */ IF maindock~="" & savemain="" THEN DO savemain = maindock maindock = "dummydummydummy" END END CLOSEDRW M2Ipath ADDTOOL "EDIT" ":" SET TOOL "@EDIT" ":"||drwcnt+1 REDRAW ":" ADDTOOL "QUIT" ":" SET TOOL "@QUIT" ":"||drwcnt+2 REDRAW ":" MESSAGE "FIN DE CONVERSION !!" flg = CLOSE('log') EDMODE OFF Exit_M2I2TM: EXIT /* =================================================== */ /* DEFINITION D'UN TOOL M2I A PARTIR DU CLIP "NEWINFO" */ /* =================================================== */ Def_M2Itool: PROCEDURE EXPOSE toolnum toolname toolsound toolimag newinfo M2Ienv defdospath maindock savemain M2Ikeys = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z F1 F2 F3 F4 F5 F6 F7 F8 F9 F10" M2Ipath = M2Ienv M2Inextpath = M2Ipath||"/"||toolnum IF POS(":",toolimag)=0 & toolimag~="" THEN toolimag = defdospath||toolimag IF POS(":",toolsound)=0 & toolsound~="" THEN toolsound = defdospath||toolsound toolname = '"'||toolname||'"' toolimag = '"'||toolimag||'"' toolsound = '"'||toolsound||'"' /*extraction des infos du clip "exec" (="newinfo")*/ ppos = POS("¶",newinfo) nt_launch = LEFT(newinfo,ppos-1) nt_arg = WORD(nt_launch,1) nt_type = WORD(nt_launch,2) nt_pri = WORD(nt_launch,3) nt_delay = WORD(nt_launch,4) nt_stack = WORD(nt_launch,5) newinfo = RIGHT(newinfo,LENGTH(newinfo)-ppos) ppos = POS("¶",newinfo) nt_cmd = LEFT(newinfo,ppos-1) newinfo = RIGHT(newinfo,LENGTH(newinfo)-ppos) ppos = POS("¶",newinfo) nt_cdir = LEFT(newinfo,ppos-1) newinfo = RIGHT(newinfo,LENGTH(newinfo)-ppos) ppos = POS("¶",newinfo) nt_hkey = LEFT(newinfo,ppos-1) newinfo = RIGHT(newinfo,LENGTH(newinfo)-ppos) ppos = POS("¶",newinfo) nt_out = LEFT(newinfo,ppos-1) newinfo = RIGHT(newinfo,LENGTH(newinfo)-ppos) ppos = POS("¶",newinfo) nt_path = LEFT(newinfo,ppos-1) /* inutilise */ newinfo = RIGHT(newinfo,LENGTH(newinfo)-ppos) ppos = POS("¶",newinfo) IF ppos~=0 THEN nt_pub = LEFT(newinfo,ppos-1) ELSE nt_pub="" newinfo = RIGHT(newinfo,LENGTH(newinfo)-ppos) /*positionement des champs M2I*/ IF nt_type > 3 THEN DO /*erreur sur exec type "hotkey" ou "acces"*/ MESSAGE "Type d'objet "||nt_type||":"||toolname||" non gere par M2i" flg = WRITELN('log',"Type d'objet "||nt_type||":"||toolname||" non gere par M2i") toolname = "HOrreur"||M2Ipath ADDTOOL toolname M2Ipath GETPATH M2Inextpath toolname = RESULT SET LABEL '"'||toolname||'"' M2Inextpath SET ICON "HOrreur" M2Inextpath /*z'yva, tet de mort*/ END IF nt_type > 3 THEN RETURN /* un tool... */ IF nt_type < 3 THEN DO ADDTOOL toolname M2Ipath SET SOUND toolsound M2Inextpath SET WB nt_type M2Inextpath SET PRI nt_pri M2Inextpath SET STACK nt_stack M2Inextpath ppos = POS(" ",nt_cmd) IF ppos~=0 THEN DO nt_arg = RIGHT(nt_cmd,LENGTH(nt_cmd)-ppos) nt_arg = "'"||nt_arg||"'" SET ARG nt_arg M2Inextpath nt_cmd = LEFT(nt_cmd,ppos-1) END IF POS(":",nt_cmd)=0 THEN nt_cmd = defdospath||nt_cmd SET TOOL nt_cmd M2Inextpath SET PATH nt_cdir M2Inextpath M2Ihkey = "" nt_hkey = UPPER(nt_hkey) IF nt_hkey~="" THEN DO DO WHILE WORDS(nt_hkey)~=0 tmhkey = GETCLIP("hotkey "||WORD(nt_hkey,1)) IF tmhkey="" & POS(WORD(nt_hkey,1),M2Ikeys)=0 THEN DO badkey = "key "||WORD(nt_hkey,1)||" non autorisee pour le tool "||nt_cmd MESSAGE badkey flg = WRITELN('log',M2Ipath||'09'x||'09'x||badkey) M2Ihkey = "" BREAK END ELSE DO IF WORDS(nt_hkey)=1 THEN tmhkey = nt_hkey M2Ihkey = M2Ihkey||tmhkey||" " END nt_hkey = DELWORD(nt_hkey,1,1) END END IF M2Ihkey~="" THEN M2Ihkey = LEFT(M2Ihkey,LENGTH(M2Ihkey)-1) /*suppr du dernier " "*/ M2Ihkey = "'"||M2Ihkey||"'" SET HOTKEY M2Ihkey M2Inextpath SET IO nt_out M2Inextpath toolnum = toolnum + 1 flg = WRITELN('log',M2Ipath||'09'x||'09'x||" Tool "||toolname||" traite") END /* un drawer... */ ELSE DO dockname = nt_cmd /*var recurs.*/ IF maindock = dockname THEN DO MESSAGE "Le dock principal ne peux etre defini en icone"||'0a'x||, "ou en menu - Veuillez le glisser en edition apres"||'0a'x||, "traduction complete du fichier de configuration" nodup = 0 dupdock = -1 END ELSE DO nodup=1 GETPATH dockname dupdock = rc IF savemain = dockname THEN DO dupdock = -1 nodup = 0 END END IF dupdock=0 THEN DO CALL check_ref_croisee M2Ipath dockname nodup = RESULT IF nodup=0 THEN DO IF maindock~="dummydummydummy" THEN DO flg = WRITELN('log',M2Ipath||'09'x||'09'x||"DUPLICA ! - Dock "||dockname) GETPATH M2Ipath ddduppath = RESULT M2Iwarn = "le dock "||dockname||" existe.duplication?" REQUEST M2Iwarn nodup = rc END END END IF nodup=1 THEN DO flg = WRITELN('log',M2Ipath||'09'x||'09'x||" Dock "||dockname||" traite") ADDDRW '"'||dockname||'"' M2Ipath SET WLIST 1 M2Inextpath /* = verticale */ SET LOCK 2 M2Inextpath /* = encadree */ REDRAW M2Ipath M2Ienv = M2Inextpath /*var recurs.*/ OPENDRW M2Ienv CALL mkdock /*procedure recursive*/ M2Ienv = M2Ipath toolnum = toolnum + 1 END END SET ICON toolimag M2Inextpath RETURN toolnum /* ================================ */ /* CREATION D'UN DOCK (=DRAWER M2I) */ /* ================================ */ /* clip dockobj : ??|hotkey|pubscreen|docktitle|??|pos|..*/ /* ..nom_execobj|imag_execobj|sound_execobj */ /* ..................................................... */ mkdock: PROCEDURE EXPOSE dockname M2Ienv defdospath savemain M2Ipath = M2Ienv toolnum = 1 dockclip = GETCLIP("dockobj "||dockname) ppos = POS("¶",dockclip) dockflags = LEFT(dockclip,ppos-1) dockclip = RIGHT(dockclip,LENGTH(dockclip)-ppos) ppos = POS("¶",dockclip) dockhkey = LEFT(dockclip,ppos-1) dockclip = RIGHT(dockclip,LENGTH(dockclip)-ppos) ppos = POS("¶",dockclip) dockpub = LEFT(dockclip,ppos-1) dockclip = RIGHT(dockclip,LENGTH(dockclip)-ppos) ppos = POS("¶",dockclip) dockfen = LEFT(dockclip,ppos-1) dockclip = RIGHT(dockclip,LENGTH(dockclip)-ppos) ppos = POS("¶",dockclip) docksizef = LEFT(dockclip,ppos-1) dockclip = RIGHT(dockclip,LENGTH(dockclip)-ppos) ppos = POS("¶",dockclip) dockpos = LEFT(dockclip,ppos-1) dockclip = RIGHT(dockclip,LENGTH(dockclip)-ppos) SET LOCK 2 M2Ipath /* = encadree */ SET XPOS WORD(dockpos,1) M2Ipath SET YPOS WORD(dockpos,2)+3 M2Ipath /* +3 because le cadre */ /* flags dock TM : */ /* 1 = activated */ /* 2 = centered */ /* 4 = frontmost */ /* 8 = menu */ /* 16 = pattern */ /* 32 = popup */ /* 64 = text */ /* 128 = vertical */ /* 256 = backdrop */ /* 512 = sticky */ IF dockflags>=128 THEN DO SET WLIST 1 M2Ipath /*vert.*/ END ELSE DO SET WLIST 0 M2Ipath /*sinon horiz.*/ END dockflags = dockflags//128 /*modulo*/ IF dockflags>=64 THEN SET WLIST 2 M2Ipath /*text*/ dockflags = dockflags//64 IF dockflags>=2 THEN SET IPLACE 0 M2Ipath /*centered*/ dockflags = dockflags//2 ppos = POS("¶",dockclip) DO WHILE ppos~=0 toolname = LEFT(dockclip,ppos-1) dockclip = RIGHT(dockclip,LENGTH(dockclip)-ppos) newinfo = GETCLIP("execobj "||toolname) IF newinfo="" THEN DO ppos = POS("¶",dockclip) ITERATE END ppos = POS("¶",dockclip) dockimag = LEFT(dockclip,ppos-1) toolimag = GETCLIP("imagobj "||dockimag) dockclip = RIGHT(dockclip,LENGTH(dockclip)-ppos) ppos = POS("¶",dockclip) docksound="" IF ppos~=0 THEN docksound = LEFT(dockclip,ppos-1) toolsound = GETCLIP("soundobj "||docksound) dockclip = RIGHT(dockclip,LENGTH(dockclip)-ppos) M2Ienv = M2Ipath CALL Def_M2Itool toolnum = RESULT REDRAW M2Ipath ppos = POS("¶",dockclip) END REDRAW M2Ipath IF dockflags=0 THEN CLOSEDRW M2Ipath dockflags = dockflags||" "||toolnum RETURN dockflags /* SOUS-ROUTINE DE TEST DE REF. CROISEE AVAL->AMONT */ check_ref_croisee: PARSE ARG pathcheck refdock nodup=0 DO WHILE LENGTH(pathcheck)>2 GETPATH pathcheck dockamont = RESULT IF POS(STRIP(refdock),dockamont)~=0 THEN DO nodup=-1 SAY "ref. croisee ! - Dock "||refdock flg = WRITELN('log',"ref. croisee ! - "||M2Ipath||" Dock "||refdock) END pathcheck = LEFT(pathcheck,LENGTH(pathcheck)-2) END RETURN nodup